<div class="alert alert-success-light">
	<i class="fa fa-warning"></i> 重要提示：后台订单列表仅供查看，如需发货、或修改订单信息请到商家后台操作！<a target="_blank" href="/index/wanlshop.console">进入商家后台</a>
</div>
<div class="panel panel-default panel-intro">
	<div class="panel-heading">
		{:build_heading(null,FALSE)}
		<ul class="nav nav-tabs" data-field="state">
			<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
			{foreach name="stateList" item="vo"}
			<li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
			{/foreach}
		</ul>
	</div>
	<div class="panel-body">
		<div id="myTabContent" class="tab-content">
			<div class="tab-pane fade active in" id="one">
				<div class="widget-body no-padding">
					<div id="toolbar" class="toolbar">
						{:build_toolbar('refresh,delete')}
						<!-- <a class="btn btn-info btn-disabled disabled btn-selected" href="javascript:;"><i class="fa fa-leaf"></i> 批量 打印发货单</a>
						<a class="btn btn-success btn-disabled disabled btn-selected" href="javascript:;"><i class="fa fa-leaf"></i> 批量 打印运单</a>
						<a class="btn btn-info btn-disabled disabled btn-selected" href="javascript:;"><i class="fa fa-leaf"></i> 批量发货</a> -->
						<a class="btn btn-warning btn-recyclebin btn-dialog {:$auth->check('wanlshop/order/recyclebin')?'':'hide'}" href="wanlshop/order/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
					</div>
					<table id="table" data-show-export="false" data-show-toggle="false" data-show-columns="false" class="table" width="100%"></table>
				</div>
			</div>

		</div>
	</div>
</div>
<script type="text/html" id="itemtpl">
	<% if(i == 0){ %>
		<div class="col-sm-12" style="margin-bottom: 15px;">
			<table class="table table-bordered table-striped table-hover table-nowrap">
			   <thead>
				   <tr>
						<th class="text-center"><div class="th-inner">商品</div></th>
						<th class="fix-108"><div class="th-inner">单价</div></th>
						<th class="fix-108"><div class="th-inner">数量</div></th>
						<th class="fix-108"><div class="th-inner">买家</div></th>
						<th class="fix-108"><div class="th-inner">实际支付</div></th>
						<th class="fix-108"><div class="th-inner">状态</div></th>
						<!-- <th class="fix-108"><div class="th-inner">操作</div></th> -->
				   </tr>
			   </thead>
			</table>
		</div>
	<% } %>
	<div class="wanl_order_list col-sm-12">
		<table class="table table-bordered table-hover ">
			<thead>
				<tr>
					<th colspan="7">
						<div class="th-inner">
							<input name="checkbox" data-id="<%=item.id%>" id="order_<%=item.id%>" type="checkbox" /> 
							<label for="order_<%=item.id%>">订单号：<%=item.order_no%></label>
							<label style="margin-left:60px;" for="order_<%=item.id%>">创建时间：<%=Moment(item.createtime*1000).format("YYYY-MM-DD HH:mm:ss")%></label>
							<a href="javascript:;" style="margin-left:60px;" class="searchit text-primary" data-toggle="tooltip" title="" data-field="shop.shopname" data-value="<%=item.shop.shopname%>" data-original-title="点击搜索 <%=item.shop.shopname%>"> <i class="fa fa-shopping-cart"></i> <%=item.shop.shopname%> </a>
						</div>
					</th>
				</tr>			   
			</thead>
			<tbody>
				<% for(var k = 0 ; k < item.ordergoods.length ; k ++){ %>
				    <% var goods = item.ordergoods[k]; %>
					<% var labelarr = ['primary', 'success', 'info', 'danger', 'warning', 'muted']; %>
				    <tr>
				    	<td class="conceal">
							<div class="item">
								<div class="order_img">
									<a href="javascript:"><img class="img-md img-center" src="<%=cdnurl(goods.image)%>" alt="<%=goods.title%>"></a>
								</div>
								<div class="order_info">
									<p><%=goods.title%></p>
									<p class="sku"><%=goods.difference%></p>
								</div>
							</div>
				    	</td>
				    	<td class="conceal fix-108">
				    		<p> <del>￥<%=goods.price%></del> </p>
				    		<p>￥<%=goods.actual_payment%></p>
				    	</td>
						<!-- 1.1.6 升级 -->
						<td class="conceal fix-108">
							<p>x<%=goods.number%></p>	
							<p><a href="javascript:;" class="refund" data-id="<%=goods.refund_id%>"><%=goods.refund_status_text%></a></p>
						</td>
						<% if(k == 0){ %>
				    	<td class="fix-108">
				    		<p style="margin-bottom:5px;">
				    			<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="user.nickname" data-value="<%=item.user.nickname%>" data-original-title="点击搜索 <%=item.user.nickname%>"><%=item.user.nickname%></a>
				    		</p>
				    	</td>
						<td class="fix-108">
							<p><strong>￥<%= item.pay.price %></strong> </p>
							<p style="color:#6c6c6c;font-family:verdana;margin-bottom:3px;"> (含运费：￥<%= item.pay.freight_price %>) </p>
						</td>
						<td class="fix-108 operation">
							<% if(item.state == 1){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[4]%>"><i class="fa fa-circle"></i> <%=item.state_text%> </span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<% }else if(item.state == 2){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[0]%>"><i class="fa fa-circle"></i> <%=item.state_text%></span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<% }else if(item.state == 3){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[2]%>"><i class="fa fa-circle"></i> <%=item.state_text%></span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<p><a href="javascript:;" class="kuaidisub" data-id="<%=item.id%>">查看物流</a> </p>
							<% }else if(item.state == 4){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[1]%>"><i class="fa fa-circle"></i> <%=item.state_text%></span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<p><a href="javascript:;" class="kuaidisub" data-id="<%=item.id%>">查看物流</a> </p>
							<% }else if(item.state == 5){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[0]%>"><i class="fa fa-circle"></i> <%=item.state_text%></span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<p><a href="javascript:;" class="kuaidisub" data-id="<%=item.id%>">查看物流</a> </p>
							<% }else if(item.state == 6){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[3]%>"><i class="fa fa-circle"></i> <%=item.state_text%></span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<p><a href="javascript:;" class="kuaidisub" data-id="<%=item.id%>">查看物流</a> </p>
							<p><a href="javascript:;" class="comment" data-id="<%=item.id%>">查看评论</a> </p>
							<% }else if(item.state == 7){ %>
							<p>
								<a href="javascript:;" class="searchit" data-toggle="tooltip" title="" data-field="state" data-value="<%=item.state%>" data-original-title="点击搜索 <%=item.state_text%>">
									<span class="text-<%=labelarr[5]%>"><i class="fa fa-circle"></i> <%=item.state_text%></span>
								</a>
							</p>
							<p><a href="javascript:;" class="detail" data-id="<%=item.id%>">订单详情</a> </p>
							<p><a href="javascript:;" class="kuaidisub" data-id="<%=item.id%>">查看物流</a> </p>
							<% } %>
						</td>
						
						<% }else{ %>
						<td class="empty"> </td>
						<td class="empty"> </td>
						<td class="empty"> </td>
						<% } %>
				    </tr>
				<% } %>
			</tbody>
		</table>
	</div>
</script>
<style type="text/css">
	@page {
		size: auto;
		margin: 0mm;
	}
	.wanl_order_list{
		margin-bottom: 15px;
	}
	.wanl_order_list .detail{
		
	}
	.fix-108{
		width: 108px;
		text-align: center;
	}
	.text-left{
		text-align: left;
	}
	.text-right{
		text-align: right;
	}
	.wanl_order_list .table>thead{
		background: #f9fafc;
	}
	.bootstrap-table .table,
	.bootstrap-table .table>thead>tr>th{
		border-bottom: 1px solid #f1f1f1;
	}
	.table-bordered{
		border: 1px solid #f1f1f1;
	}
	.table-bordered > thead > tr > th, 
	.table-bordered > tbody > tr > td {
		border: 1px solid #f1f1f1;
		border-bottom: 0;
	}
	.table-bordered > thead > tr > th, label{
		margin-bottom: 0;
		font-weight: normal;
	}
	.table-bordered > tbody td.empty{
		border-top: 0;
	}
	.table-bordered > tbody td.conceal{
		border-left: 0 ;
		border-right: 0 ;
	}
	.table-bordered > tbody td.conceal.fix-108{
	}
	.table-hover > tbody > tr:hover {
	  background-color: #fffbfb;
	}
	/* 产品 */
	.wanl_order_list p{
		margin-bottom: 4px;
	}
	.wanl_order_list .item {
		display: flex;
		margin: 10px;
	}
	
	.wanl_order_list .item .order_img {
		overflow: hidden;
		border-radius: 6px;
		flex-shrink: 0;
	}
	.wanl_order_list .item .order_info {
		width: 90%;
		margin-left: 10px;
		margin-top: 2px;
	}
	.wanl_order_list .item .order_info .sku {
		color: #9e9e9e;
	}
	
	.wanl_order_list .refund{
		color: #e74c3c; font-size: 12px;
	}
	
	.wanl_order_list .operation a{
		color: #565656;
	}
	.no-records-found{
		background-color: #fffbfb;
	}
</style>